Skip to content

Conversation

@cmworkato
Copy link
Collaborator

Complete package rename with PyPI deployment support

Changes

  • Rename package from workato_platform to workato_platform_cli
  • Update all import statements throughout codebase
  • Regenerate OpenAPI client with correct package name
  • Add PyPI deployment workflow
  • Fix all test imports and references
  • Restore _configure_retry_with_429_support function
  • Update build configuration and versioning

Testing

  • All 903 tests passing
  • CLI functionality verified
  • PyPI test deployment successful (v1.0.0rc3.dev17)
  • Package imports work correctly

Breaking Changes

  • Package name changed from workato-platform to workato-platform-cli
  • Import paths changed from workato_platform to workato_platform_cli

Ready for production PyPI deployment.

- Update all import statements throughout source code
- Regenerate OpenAPI client with correct package name
- Restore _configure_retry_with_429_support function lost during rename
- Update openapi-config.yaml packageName configuration
- Fix all internal module references and dependencies
- Fix all test import statements from workato_platform to workato_platform_cli
- Update patch decorators and mock references
- Fix path references in test files
- Ensure all 903 tests pass with new package structure
@github-actions
Copy link

github-actions bot commented Oct 29, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
__init__.py68494%10–11, 69–70
cli
   __init__.py52394%49, 51, 60
   containers.py270100% 
cli/commands
   __init__.py00100% 
   api_clients.py286996%24, 297, 442–443, 476, 486, 576, 607, 615
   api_collections.py253398%25, 178, 340
   assets.py46295%51–52
   connections.py520599%582, 584, 590, 628, 977
   data_tables.py163596%28, 248, 262, 316–317
   guide.py166199%106
   init.py890100% 
   profiles.py1970100% 
   properties.py95198%18
   pull.py171298%190–191
   workspace.py38294%57, 67
cli/commands/connectors
   __init__.py00100% 
   command.py88297%105, 154
   connector_manager.py203498%176, 292, 300–301
cli/commands/projects
   __init__.py00100% 
   command.py2691096%353–356, 367, 433–435, 485, 489
   project_manager.py166795%48, 66, 263–264, 276, 317, 325
cli/commands/push
   __init__.py00100% 
   command.py132496%101, 104, 222, 300
cli/commands/recipes
   __init__.py00100% 
   command.py423997%113, 129–130, 267–270, 397, 703
   validator.py7062097%174, 883, 1136, 1223, 1246, 1279, 1281–1282, 1359–1361, 1457–1458, 1517–1518, 1707–1708, 1736–1738
cli/utils
   __init__.py30100% 
   exception_handler.py198696%137, 184, 211, 238, 295, 330
   gitignore.py140100% 
   ignore_patterns.py230100% 
   spinner.py430100% 
   version_checker.py135695%24, 26, 33–34, 72, 102
cli/utils/config
   __init__.py50100% 
   manager.py4671995%125, 136–138, 141, 154, 204–205, 357, 438–439, 478, 692, 835–836, 850–851, 912, 971
   models.py330100% 
   profiles.py3091096%93, 189–190, 193, 228–230, 255–257
   workspace.py680100% 
TOTAL545613497% 

Comment on lines +23 to +110
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
environment: ${{ steps.determine-env.outputs.environment }}

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for hatch-vcs versioning

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"

- name: Install build dependencies
run: |
uv pip install --system build hatch hatch-vcs twine

- name: Determine environment
id: determine-env
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "environment=${{ inputs.environment }}" >> $GITHUB_OUTPUT
elif [[ "${{ github.ref }}" == "refs/heads/test" ]]; then
echo "environment=test" >> $GITHUB_OUTPUT
elif [[ "${{ github.ref }}" == "refs/heads/release" ]] || [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "environment=release" >> $GITHUB_OUTPUT
fi

- name: Get version and configure for environment
id: version
run: |
# Get version from git tags
BASE_VERSION=$(git describe --tags --always --match="*.*.*" | sed 's/^v//')
if [[ -z "$BASE_VERSION" || "$BASE_VERSION" == *"-"* ]]; then
# Fallback: use the latest tag or default
BASE_VERSION=$(git tag --sort=-version:refname | head -n1 | sed 's/^v//')
if [[ -z "$BASE_VERSION" ]]; then
BASE_VERSION="1.0.0rc4"
fi
fi
echo "Base version: $BASE_VERSION"

if [[ "${{ steps.determine-env.outputs.environment }}" == "test" ]]; then
# Test environment: append .devN
VERSION="${BASE_VERSION}.dev${{ github.run_number }}"
echo "Development version: $VERSION"
echo "SETUPTOOLS_SCM_PRETEND_VERSION=${VERSION}" >> $GITHUB_ENV
else
# Production environment: use version as-is
VERSION="${BASE_VERSION}"
echo "Production version: $VERSION"

# Verify no dev suffix for production
if [[ "$VERSION" =~ "dev" ]]; then
echo "Error: Version contains 'dev' suffix. Production releases must be clean versions."
echo "Current version: $VERSION"
echo "Please create a git tag (e.g., v1.0.0) on the release branch."
exit 1
fi
fi

echo "version=${VERSION}" >> $GITHUB_OUTPUT

- name: Build package
run: python -m build

- name: Check package
run: |
twine check dist/*
ls -lh dist/
echo "Package version: ${{ steps.version.outputs.version }}"

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ steps.determine-env.outputs.environment }}
path: dist/

publish-test:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 3 months ago

To fix the problem, you should add an explicit permissions: block to the build job in the workflow YAML (.github/workflows/pypi.yml). This block should specify only the permissions needed by the build job. In practice, for jobs that just need access to the code (e.g., checkout), contents: read is sufficient.

  • Add the following beneath line 23 (runs-on: ubuntu-latest):

    permissions:
      contents: read

This change explicitly ensures that this job’s GITHUB_TOKEN can only read repository contents, and cannot write or modify anything, reducing the risk of privilege escalation or unintended actions.

Suggested changeset 1
.github/workflows/pypi.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml
--- a/.github/workflows/pypi.yml
+++ b/.github/workflows/pypi.yml
@@ -21,6 +21,8 @@
 jobs:
   build:
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
     outputs:
       version: ${{ steps.version.outputs.version }}
       environment: ${{ steps.determine-env.outputs.environment }}
EOF
@@ -21,6 +21,8 @@
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
version: ${{ steps.version.outputs.version }}
environment: ${{ steps.determine-env.outputs.environment }}
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
- Break long function signatures and imports
- Add noqa comments for unavoidable long imports
- Format code with ruff
- All lint checks now pass
@hovu96 hovu96 merged commit e7d7a23 into main Oct 29, 2025
8 checks passed
@hovu96 hovu96 deleted the test branch October 29, 2025 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants